package com.matrix.java.chap_04;

import java.util.Scanner;

/*
    几何：六边形面积
 */
public class Ex4_04 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("Enter the side: ");
        double s = input.nextDouble();
        double area = (6 * Math.pow(s, 2)) / (4 * Math.tan(Math.PI / 6));
        System.out.printf("The area of the polygon is %.2f\n", area);
        input.close();
    }
}
